package com.bw.kotlinim.contract.splash

import com.hyphenate.chat.EMClient

class SplashPresenter(private val view: SplashContract.View) : SplashContract.Presenter {
    override fun checkLoginStatus() {
        if (isLoggedIn()) view.onLoggedIn() else view.onNotLoggedIn()
    }

    private fun isLoggedIn(): Boolean = EMClient.getInstance().isConnected&&EMClient.getInstance().isLoggedInBefore
}